﻿using LuShanTea.Service.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.Service.ModelConfig
{
    public class CartRecordConfig:EntityTypeConfiguration<CartRecord>
    {
        public CartRecordConfig()
        {
            this.ToTable("T_CartRecords");
            this.HasRequired(e => e.Cart).WithMany().HasForeignKey(e => e.CartId).WillCascadeOnDelete(false);

            HasRequired(o => o.Good).WithMany().HasForeignKey(o => o.GoodId).WillCascadeOnDelete(false);

            HasRequired(e => e.Pack).WithMany().HasForeignKey(e=>e.PackId);
        }
    }
}
